package com.wtwd.campus.receiver;

import com.wtwd.campus.entity.MqLockDevice;
import com.wtwd.campus.service.InjectFeignService;

/**
 * @author mjy
 * @date 2023/02/16
 * @description
 */
public class GetLockDeviceReceiver implements Receiver {
//    *TJ,IMEI,GETLOCKDEVICE,seq,switch,iccid,tracker _status#
    @Override
    public String parseMessage(String data) {
        String[] split = data.split(",");
        String imei = split[1];
        String commandNumber = split[3];
        String flag = split[4];
        String iccid = split[5];
        MqLockDevice mqLockDevice = new MqLockDevice();
        mqLockDevice.setFlag(Integer.valueOf(flag));
        mqLockDevice.setCommandNumber(commandNumber);
        mqLockDevice.setImei(imei);
        mqLockDevice.setIccid(iccid);
        InjectFeignService.getIrmFeignClientService().getLockDeviceReceiver(mqLockDevice);
        return imei;
    }
}
